package com.ssi.report.common.constant;

import java.text.DecimalFormat;

import org.apache.commons.lang.math.NumberUtils;

import com.ssi.report.common.utils.SSPropertiesUtils;

/** 
 * 
 * 	Developed By 	: Kroekpong Sakulchai
 *  Date 			: 09-MAY-2014
 *  Version 		: Alpha
 *  Team			: Software Solution And Integration
 *   
 * **/

public class ReportConstant {
	
	

	public static final String CONFIG_REPORT_MAP = "report";
	public static final String CONFIG_APPLICATION = "application";
	public static final String CONFIG_REPORT = "report";

	public static final String CONFIG_APP_TEST = getProp(CONFIG_REPORT,"application.softsai.test");
	public static final String CONFIG_APP_LIMIT = getProp(CONFIG_REPORT,"application.softsai.test.limit");
	public static final int CONFIG_APP_LIMIT_ROWS = NumberUtils.toInt( getProp(CONFIG_REPORT,"application.softsai.test.limitrows")) ;
	public static final String CONFIG_LOG = getProp(CONFIG_REPORT,"log.softsai.debug");
	
	public static final String CONFIG_JDBC_URL =  getProp(CONFIG_APPLICATION,"jdbc.url");
	public static final String CONFIG_JDBC_DRIVER = getProp(CONFIG_APPLICATION,"jdbc.driver");
	public static final String CONFIG_JDBC_USERNAME = getProp(CONFIG_APPLICATION,"jdbc.username");
	public static final String CONFIG_JDBC_PASSWORD = getProp(CONFIG_APPLICATION,"jdbc.password");
	
	public static final String CONFIG_REPORT_TEMPLATE_FORMAT_DAYFOLDER = getProp(CONFIG_REPORT,"report.template.dayfolder.format");
	public static final String CONFIG_REPORT_TEMPLATE_PATH = getProp(CONFIG_REPORT,"report.template.path");
	public static final String CONFIG_REPORT_TEMPLATE_FILENAME_A = getProp(CONFIG_REPORT,"report.template.filenameA");
	public static final String CONFIG_REPORT_TEMPLATE_FILENAME_B = getProp(CONFIG_REPORT,"report.template.filenameB");
	public static final String CONFIG_REPORT_OUTPUT_PATH = getProp(CONFIG_REPORT,"report.output.path");
	public static final String CONFIG_REPORT_OUTPUT_FILENAME = getProp(CONFIG_REPORT,"report.output.filename");
	
	public static final String CONFIG_REPORT_PARTY_A = getProp(CONFIG_REPORT, "report.text.partyA" );
	public static final String CONFIG_REPORT_PARTY_B =  getProp(CONFIG_REPORT, "report.text.partyB" );
	public static final String CONFIG_REPORT_SETTLE_AMOUNT =  getProp(CONFIG_REPORT, "report.text.settlementAmt" );
	public static final String CONFIG_REPORT_REFERENCE_TXT =  getProp(CONFIG_REPORT, "report.text.reference" );
	public static final String CONFIG_REPORT_REFERENCE_LABEL =  getProp(CONFIG_REPORT, "report.label.reference" );
	public static final String CONFIG_REPORT_VALUATION_TXT =  getProp(CONFIG_REPORT, "report.text.valuation" );
	public static final String CONFIG_REPORT_VALUATION_LABEL =  getProp(CONFIG_REPORT, "report.label.valuation" );
	public static final String CONFIG_REPORT_PAYMENT_PARTY_A1 = getProp(CONFIG_REPORT, "report.text.paymentPartyA1" );
	public static final String CONFIG_REPORT_PAYMENT_PARTY_A2 = getProp(CONFIG_REPORT, "report.text.paymentPartyA2" );
	public static final String CONFIG_REPORT_PAYMENT_PARTY_B =  getProp(CONFIG_REPORT, "report.text.paymentPartyB" );

	public static final String CONFIG_BLANK_SPACE_TXT = " " ;
	public static final String CONFIG_FLAG_1 = "1" ;
	public static final String CONFIG_FLAG_Y = "Y" ;
	public static final String CONFIG_PER_TXT = "per " ;
	public static final String CONFIG_THB = "THB" ;
	
	public static final String CONFIG_QTY_FORMAT = "#,###";
	public static final String CONFIG_PRICE_FORMAT = "#,##0.00";
	public static final DecimalFormat  PRICE_FORMAT = new DecimalFormat(CONFIG_PRICE_FORMAT) ;
	public static final DecimalFormat  QTY_FORMAT = new DecimalFormat(CONFIG_QTY_FORMAT) ;
	
	
	public static String getProp(String name ,String prop) {
		return SSPropertiesUtils.getProperties(name, prop);
	}
	
	public static void main(String[] args) {
//		DecimalFormat format = new DecimalFormat(CONFIG_PRICE_FORMAT);
//		System.out.println(PRICE_FORMAT.format(2222222222222222222222.55));
	}
	
}
